API Documentation
Quaternion.h
1 // Quaternion.h
3 //
5 
6 namespace nkMaths
7 {
13  class Quaternion
14  {
15  public :
16 
17  // Attributes
18  float _x ;
19  float _y ;
20  float _z ;
21  float _w ;
22 
23  public :
24 
38  Quaternion (float x, float y, float z, float w) ;
45  Quaternion (const Vector& axis, float angle) ;
51  Quaternion (const Vector& eulerAngles) ;
57  Quaternion (const Matrix& mat) ;
63  Quaternion (const Quaternion& other) ;
68 
73 
81  Quaternion& setFromAxisAngle (const Vector& axis, float angle) ;
88  Quaternion& setFromEuler (const Vector& angles) ;
103 
104  // Transformations
112  Vector transform (const Vector& vector) const ;
120  Vector& apply (Vector& vector) const ;
121 
122  // Utilities
129  void fromString (const nkMemory::StringView& str) ;
130 
131  // Operators
144  Vector operator* (const Vector& other) const ;
151  Quaternion operator* (const Quaternion& other) const ;
157  void operator*= (const Quaternion& other) ;
164  bool operator== (const Quaternion& other) const ;
165  } ;
166 }
nkMaths::Quaternion::operator*=
void operator*=(const Quaternion &other)
nkMaths::Quaternion::~Quaternion
~Quaternion()
nkMaths::Quaternion::_z
float _z
Z component of the quaternion.
Definition: Quaternion.h:20
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkMaths::Quaternion
A quaternion, symbolizing rotations as a 4D vector.
Definition: Quaternion.h:14
nkMaths::Quaternion::operator=
Quaternion & operator=(const Quaternion &other)
nkMaths::Quaternion::apply
Vector & apply(Vector &vector) const
nkMaths::Quaternion::Quaternion
Quaternion(const Vector &axis, float angle)
nkMaths::Quaternion::setFromEuler
Quaternion & setFromEuler(const Vector &angles)
nkMaths::Matrix
Represents a 4x4 float matrix.
Definition: Matrix.h:14
nkMaths::Quaternion::_y
float _y
Y component of the quaternion.
Definition: Quaternion.h:19
nkMaths::Quaternion::setFromAxisAngle
Quaternion & setFromAxisAngle(const Vector &axis, float angle)
nkMaths::Quaternion::Quaternion
Quaternion(const Vector &eulerAngles)
nkMaths::Quaternion::Quaternion
Quaternion(const Quaternion &other)
nkMaths::Quaternion::operator==
bool operator==(const Quaternion &other) const
nkMaths::Quaternion::setFromOrientationMatrix
Quaternion & setFromOrientationMatrix(const Matrix &mat)
nkMaths::Quaternion::setFromTransformationMatrix
Quaternion & setFromTransformationMatrix(const Matrix &mat)
nkMaths::Quaternion::transform
Vector transform(const Vector &vector) const
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMaths::Quaternion::_x
float _x
X component of the quaternion.
Definition: Quaternion.h:18
nkMaths::Quaternion::_w
float _w
W component of the quaternion.
Definition: Quaternion.h:21
nkMaths::Quaternion::Quaternion
Quaternion(float x, float y, float z, float w)
nkMaths::Quaternion::fromString
void fromString(const nkMemory::StringView &str)
nkMaths::Quaternion::Quaternion
Quaternion(const Matrix &mat)
nkMaths::Quaternion::getAsEulerAngles
Vector getAsEulerAngles() const
nkMaths::Quaternion::operator*
Vector operator*(const Vector &other) const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkMaths::Quaternion::Quaternion
Quaternion()